package com.evil.kingdom.pojo.entity.person.soldier;

import com.evil.kingdom.pojo.entity.base.Loyalty;
import com.evil.common.mongo.entity.SingleName;
import com.evil.kingdom.pojo.entity.person.base.Person;
import com.evil.kingdom.pojo.entity.person.base.PersonType;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * 士兵
 *
 * @author liyang
 * @date 2024-05-17 16:34
 */
@Getter
@Setter
@Document
public class Soldier implements SingleName, Loyalty, PersonType {

    /**
     * 名称
     *
     * @see Person#getName()
     */
    @Id
    @NotBlank(message = "名称不能为空")
    private String name;

    /**
     * 归属（君主）
     *
     * @see Person#getName()
     */
    private String belong;

    /**
     * 忠诚度（0-100）
     */
    private Integer loyalty;

    /**
     * 勇力值（0-100）
     */
    @NotNull(message = "勇力值不能为空")
    private Integer courage;

    /**
     * 兵种
     */
    @NotBlank(message = "兵种不能为空")
    private String soldierType;

    public Soldier() {
        this.courage = 100;
    }

    @Override
    public String getEntityName() {
        return "士兵";
    }
}
